// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import Vuex from 'vuex'
import iView from 'iview'
import Plugin from '@/common/vuePlugin'
import 'iview/dist/styles/iview.css'
import 'animate.css'
import store from './store'
import '@/style/main.less'
import $ from '@/common'
window.common = $
$.set = Vue.set
Vue.config.productionTip = false
Vue.use(Vuex)
Vue.use(iView)
Vue.use(Plugin)

$.checkUser().then(() => {
  window.APP = new Vue({
    el: '#app',
    router,
    store,
    template: '<App/>',
    components: {
      App
    }
  })
}).catch(() => {
  $.returnToLogin()
})